package com.company;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.LinkedHashMap;
import java.util.Map;

/**
 * @author Administrator
 */

public class HJ19简单错误记录 {
    public static void main(String[] args) throws IOException {

        Map<String, Integer> map = new LinkedHashMap<>();
        BufferedReader bf = new BufferedReader(new InputStreamReader(System.in));
        String str;
        while ((str = bf.readLine()) != null) {
            int lastIndexOf = str.lastIndexOf("\\");
            int lastIndex = str.lastIndexOf(" ");
            String key = (lastIndex - lastIndexOf) > 16 ? str.substring(lastIndex - 16)
                            : str.substring(lastIndexOf + 1);
            map.put(key, map.getOrDefault(key, 0) + 1);
        }
        int count = 0;
        for (String key : map.keySet()) {
            count++;
            if (count > (map.size() - 8)) {
                System.out.println(key + " " + map.get(key));
            }
        }

    }


}
